import {createAPI, createFormAPI} from '@/utils/request'

export const getList = data => createAPI('/api/serviceType', 'get', data)
export const getDetails = data => createAPI(`/api/serviceType/${data.parentId}`, 'get')
export const updateData = data => createAPI(`/api/serviceType/${data.id}`, 'put', data)
export const addData = data => createAPI(`/api/serviceType`, 'post', data)
export const delData = id => createAPI(`/api/serviceType/${id}`, 'delete')

export const getSubList = data => createAPI(`/api/serviceSubtype`, 'get', data) // 获取二级分类
export const getSubSimList = data => createAPI(`/api/simple/serviceSubType`, 'get', data) // 获取二级分类下拉
export const getSubDetails = data => createAPI(`/api/serviceSubtype/${data.id}`, 'get')
export const updateSubData = data => createAPI(`/api/serviceSubtype/${data.id}`, 'put', data)
export const addSubData = data => createAPI(`/api/serviceSubtype`, 'post', data)
export const delSubData = id => createAPI(`/api/serviceSubtype/${id}`, 'delete')
